export default class OAuthFailed extends Error {
    constructor(messageOrError) {
        // 如果传入的是 Error 实例
        if (messageOrError instanceof Error) {
            super(messageOrError.message);
        }
        // 如果传入的是字符串消息
        else {
            super(messageOrError);
        }
        this.name = 'OAuthFailed';
        // 确保堆栈跟踪正确
        if (Error.captureStackTrace) {
            Error.captureStackTrace(this, this.constructor);
        }
    }
}